package com.bcx.crm.spring.ioc;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * @Author: ys
 * @Date:Create in 2018/5/29 9:58
 * @Description:
 */
public class ClassNameForProperties {
    public static void main(String[] args) throws ClassNotFoundException, IOException, IllegalAccessException, InstantiationException {
        Properties properties = new Properties();
        properties.load(new FileInputStream(new File("D:\\my\\mySvn\\miaohui8023\\crm\\src\\main\\resources\\practice\\className.properties")));
        String property = properties.getProperty("bookService.name");
        Class<?> aClass = Class.forName(property);
        Object o = aClass.newInstance();
        System.out.println(o);
    }
}
